package com.example.starseas_phone.Adapters;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.example.starseas_phone.Entity.AddEvaluation;
import com.example.starseas_phone.Entity.Students;
import com.example.starseas_phone.R;

import java.util.List;

public class Tea_AllStudentslistviewAdapter extends ArrayAdapter<Students> {

    private int id;
    private Context mcontext;

    public Tea_AllStudentslistviewAdapter(@NonNull Context context, int resource, @NonNull List<Students> objects) {
        super(context, resource, objects);
        id = resource;
        mcontext = context;
    }

    @NonNull
    @Override
    public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
        Students students = getItem(position);
        View view = LayoutInflater.from(parent.getContext()).inflate(id,parent,false);
        TextView tea_all_students_listview_StuName = (TextView) view.findViewById(R.id.tea_all_students_listview_StuName);
        TextView tea_all_students_listview_StuSex = (TextView) view.findViewById(R.id.tea_all_students_listview_StuSex);
        TextView tea_all_students_listview_StuPhone = (TextView) view.findViewById(R.id.tea_all_students_listview_StuPhone);

        tea_all_students_listview_StuName.setText(students.getStuName());
        tea_all_students_listview_StuSex.setText(students.getStuSex());
        tea_all_students_listview_StuPhone.setText(students.getStuPhone());

        return view;
    }

}
